#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMouseEvent>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->setWindowTitle("scane");
    scene= new QGraphicsScene();
    scene->setSceneRect(0, 0, 1000, 650);
    this->resize(1000,640);
    this->setFixedSize(1000,640);
    ui->map->setScene(scene);

}


void MainWindow::mousePressEvent(QMouseEvent *event)
{
    if (event->button() == Qt::LeftButton)
    {
        scene->addEllipse(event->x(),event->y(),20,20,QPen(Qt::blue),QBrush(Qt::blue));
    }
    if (event->button() == Qt::RightButton)
    {
        scene->addRect(event->x(),event->y(),30,30, QPen(Qt::red),QBrush(Qt::red));
    }
}
MainWindow::~MainWindow()
{
    delete ui;
	delete scane;
}
